﻿using Basic.FlowRemoteModel.FlowNode;
using Basic.FlowRemoteModel.FlowNode.Model;
using Basic.FlowService.Interface;
using WeDonekRpc.Client.Interface;

namespace Basic.FlowService.RpcEvent
{
    internal class FlowNodeEvent : IRpcApiService
    {
        private readonly IFlowNodeService _Service;

        public FlowNodeEvent ( IFlowNodeService service )
        {
            this._Service = service;
        }
        public bool SetFlowNodeForm ( SetFlowNodeForm set )
        {
            return this._Service.SetForm(set.Id, set.Form);
        }
        public void DeleteFlowNode ( DeleteFlowNode obj )
        {
            this._Service.Delete(obj.Id);
        }
        public bool SetFlowNodeIntoOut ( SetFlowNodeIntoOut obj )
        {
            return this._Service.SetIntoOut(obj.Id, obj.Datum);
        }
        public bool SetFlowBeginNode ( SetFlowBeginNode obj )
        {
            return this._Service.SetBeginNode(obj.Id, obj.Node);
        }
        public long AddFlowNode ( AddFlowNode obj )
        {
            return this._Service.Add(obj.Datum);
        }
        public bool SetFlowNode ( SetFlowNode obj )
        {
            return this._Service.Set(obj.Id, obj.Datum);
        }
        public void SetFlowNodeCoordinate ( SetFlowNodeCoordinate obj )
        {
            this._Service.SetCoordinate(obj.Id, obj.Point);
        }
        public FlowNodeDto GetFlowNode ( GetFlowNode obj )
        {
            return this._Service.Get(obj.Id);
        }
        public FlowNodeBase[] GetFlowNodeList ( GetFlowNodeList obj )
        {
            return this._Service.GetNodes(obj.FlowId);
        }
    }
}
